package DesignPatern.A15_组合模式.QSB.A02_优化基础模式;

import java.util.ArrayList;

/**
 * @Author: Du
 * @Date: 2021/8/2 10:09
 */
public class Branch implements IBranch
{
    private String name = "";
    private String position = "";
    private int salary = 0;
    
    ArrayList<ICrop> list = new ArrayList<>();
    
    public Branch(String name, String position, int salary)
    {
        this.name = name;
        this.position = position;
        this.salary = salary;
    }
    
    @Override
    public void addSubList(ICrop iCrop)
    {
        this.list.add(iCrop);
    }
    
    @Override
    public ArrayList<ICrop> getSubList()
    {
        return this.list;
    }
    
    @Override
    public String getInfo()
    {
        String info = "名称" + this.name;
        info += "职位" + this.position;
        info += "薪水" + this.salary;
        return info;
    }
}
